package ui.face {
	
	import flash.display.Sprite;
	import flash.utils.Dictionary;
	
	public class QuickBarFace extends Sprite {
		
		private var itemList:Array;
		
		public function QuickBarFace() {
			super();
			
			itemList = new Array();
			var item:QuickBarItem;
			item = new QuickBarItem("quick_train");
			item.x = 0;
			item.y = 0;
			addChild(item);
			itemList[0] = item;
			
			item = new QuickBarItem("quick_strong");
			item.x = 0;
			item.y = 32;
			addChild(item);
			itemList[1] = item;
			
			itemList[0].update("训练 5/5");
			itemList[1].update("武器需要强化");
		}
		
		public function update():void {
			
		}
	}
}

import flash.display.Bitmap;
import flash.display.Sprite;

import globals.Global;

import ui.component.Label;

class QuickBarItem extends Sprite {
	
	private var icon:Bitmap;
	private var label:Label;
	
	public function QuickBarItem(iconUrl:String) {
		icon = new Bitmap(Global.assetsManager.getAssetsAsBitmapData(iconUrl));
		icon.x = 12 - icon.width * 0.5;
		icon.y = 12 - icon.height * 0.5;
		addChild(icon);
		
		label = new Label(12, 0xFFFFFF, true, "left", true);
		label.x = 30;
		label.y = 2;
		addChild(label);
	}
	
	public function update(text:String):void {
		label.text = text;
	}
}